function Core_Knowledges(gui, user, date, options, message) {
  this._gui = gui;
  this._user = user;
  this._date = date;
  this._options = options;
  this._message = message;
  
  //Data
  this._bases = (this._message['k']) ? this._message['k'] : [];
  this._deletes = [];
  
  this._createElements();
};

Core_Knowledges.prototype._createElements = function() {
  var _self = this;
  DOMUtils.removeTableRows(this._gui.content, 1);
  
  //Display
  for (var i = 0, il = this._bases.length; i < il; i++) {
    var base = this._bases[i];
    var tr, td, elm, _self = this;
    
    tr = this._gui.content.insertRow(-1);
    tr.style.backgroundColor = (tr.rowIndex % 2 == 1) ? '#fff' : '#ccc';
    td = tr.insertCell(-1);
    elm = document.createElement('input');
    elm.type = 'checkbox';
    var checked = false;
    for (var j = 0, jl = this._deletes.length; j < jl; j++) {
      var del = this._deletes[j];
      if (del.trackId == base.trackId) {
        checked = true;
      }
    }
    elm.defaultChecked = checked;
    elm._base = base;
    elm.onclick = function() { if (this.checked) {
                                 _self._deletes[_self._deletes.length] = this._base;
                               } else {
                                 MiscUtils.remove(_self._deletes, this._base, 'trackId');
                               }
    };
    td.appendChild(elm);
    
    td = tr.insertCell(-1);
    td.style.paddingLeft = '10px';
    elm = document.createElement('a');
    elm.href = '?t=knowledge&c=1&i=' + base.id;
    elm.appendChild(document.createTextNode(base.title));
    td.appendChild(elm);
    
    td = tr.insertCell(-1);
    td.style.paddingRight = '10px';
    td.appendChild(document.createTextNode(base.type));
    
    td = tr.insertCell(-1);
    td.style.paddingRight = '10px';
    td.appendChild(document.createTextNode(base.intro));
  }
  
  this._gui.checkAll.onclick = function() { if (this.checked) {
                                              _self._deletes = MiscUtils.clone(_self._bases);
                                            } else {
                                              _self._deletes = [];
                                            }
                                            _self._createElements();
                                          };

  //Event
  this._gui.add.onclick = function() { location.href = '?t=knowledge&c=1'; };
  
  this._gui.delete.onclick = function() { if (_self._deletes.length == 0) {
                                            window.alert('Choose One');
                                            return;
                                          }
                                          var pos = DOMUtils.findPos(this);
                                          new RequestUtils()._custom('deleteknowledge', JSON.stringify(_self._deletes), function(result, params) { location.reload(); }, {php: 'custom/server.php', pos: (pos) ? pos : null});
                                        };
  
};
